/**
 * Created with IntelliJ IDEA.
 * User: zet
 * Date: 13-3-5
 * Time: 下午7:42
 * To change this template use File | Settings | File Templates.
 */

/**
 * Created with IntelliJ IDEA.
 * User: zet
 * Date: 13-1-15
 * Time: 下午4:21
 * To change this template use File | Settings | File Templates.
 */

describe('测试Map的get和put', function(){
    var testMap = null,
        key1 = 'key1',
        key2 = 'key2',
        obj1 = {
            name: 'chenjun',
            tel: 15158114079
        },
        obj2 = {
            name: 'xiaolei',
            tel: 151518114033
        };

    beforeEach(function(){
        testMap = new Map();
    });

    it('测试put方法', function(){
        testMap.put(key1, obj1);
        testMap.put(key2, obj2);

        expect(testMap.entry.key1).toEqual(obj1);
        expect(testMap.entry.key2).toEqual(obj2);
    });

    it('测试get方法', function(){
        testMap.put(key1, obj1);
        testMap.put(key2, obj2);

        expect(testMap.get(key1)).toEqual(obj1);
        expect(testMap.get(key2)).toEqual(obj2);
    });

});
